#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>

int main()
{
    long long input = 0;
    while (~scanf("%lld", &input))
    {
        long long tmp = input;
        unsigned int num = 0;
        while (tmp > 0)
        {
            tmp /= 10;
            num++;
        }
        int first = 0;
        if (num <= 3)
        {
            printf("%lld", input);
        }
        else if (num > 3 && num <= 6)
        {
            printf("%lld,%lld", input / 1000, input % 1000);
        }
        else if (num > 6 && num <= 9)
        {
            printf("%lld,%lld,%lld", input / 1000000, input / 1000 % 1000, input % 1000);
        }
        else
        {
            printf("%lld", input / 1000000000);
            printf(",");
            printf("%lld,%lld,%lld", input / 1000000 % 1000, input / 1000 % 1000, input % 1000);
            printf("\n");
        }
    }
    return 0;
}